package com.ilop.sthome.mvp.contract.config;

import android.content.Intent;
import android.text.SpannableString;

import com.aliyun.alink.business.devicecenter.api.add.DeviceInfo;
import com.example.common.mvp.IBasePresenter;
import com.example.common.mvp.IBaseView;
import com.ilop.sthome.data.bean.Device;
import com.ilop.sthome.data.greenDao.DeviceInfoBean;

/**
 * @author skygge
 * @date 2020/4/17.
 * GitHub：javofxu@github.com
 * email：skygge@yeah.net
 * description：配网业务逻辑
 */
public interface ConnectNetContract {

    interface IView extends IBaseView {

        void showInitializationView();

        void showCurrentProgress(String progress);

        void showConnectNetSuccess(String deviceName);

        void showConnectNetError(int status, String msg);

        void showConnectMessage(String msg);

        void bindSuccess(String deviceName);

        void showAlreadyInRoom(String deviceName);

        void showToastMsg(String msg);

        void startActivityByIntent(Intent intent);

        void startForResultByIntent(Intent intent);
    }

    interface IPresent extends IBasePresenter<IView>{

        void getInitialization(String ssId, String pwd, boolean isWiFiAp);

        void smartOrApConnect(boolean isPhoneAp);//一键配网或手机Ap配网

        void startConfig(DeviceInfo deviceInfo);

        void startConnectNet();

        void refreshProgress(int progress);

        void connectNetSuccess(DeviceInfo deviceInfo);

        void bindDevice(Device device);

        void connectNetError();

        void parameterError();

        void removeProductInfo();

        void checkWiFiStatus();

        void onSkipToOpenWiFi();

        void skipToGateway(String deviceName);

        void setCurrentGateway(String iotId);

        void renameGateway(String iotId, String nickname);

        void getGatewayList();

        void setGatewayRoomId(DeviceInfoBean gateway);

        SpannableString getReasonSpan();

        SpannableString getRestoreFactory();
    }
}
